package cn.wolfcode.wolf2w.controller;

import cn.wolfcode.wolf2w.domain.Detail;
import cn.wolfcode.wolf2w.domain.Spot;
import cn.wolfcode.wolf2w.query.SpotQuery;
import cn.wolfcode.wolf2w.service.IDetailService;
import cn.wolfcode.wolf2w.service.ISpotService;
import cn.wolfcode.wolf2w.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
* 景点控制层
*/
@RestController
@RequestMapping("/spot")
public class SpotController {
    @Autowired
    private ISpotService spotService;
    @Autowired
    private IDetailService detailService;
    @GetMapping("/get")
    public Object get(String detailId) {
        List<Spot> list = spotService.list();
        return  JsonResult.success(list);
    }
    @GetMapping("/detail")
    public Object detail(String id) {
        Detail detail = detailService.get(id);
        return  JsonResult.success(detail);
    }

}
